package com.relatev.minecraft.TRMExample;

import com.relatev.minecraft.TRMobAPI.TRJsonConfigurable;
import com.relatev.minecraft.TRMobAPI.TRMob;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Projectile;
import org.bukkit.event.EventHandler;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.metadata.Metadatable;

public class TestSkeleton extends TRMob implements TRJsonConfigurable {

    public TestSkeleton() {
        super("§c爆炸弓箭小白", EntityType.SKELETON);
    }

    @EventHandler
    public void onArrowHit(ProjectileHitEvent event) {
        if (super.isThisMob((Metadatable) event.getEntity().getShooter())) {
            Projectile proj = event.getEntity();
            proj.getWorld().createExplosion(proj.getLocation(), 1.5F);
        }
    }
}
